Skip to content

Conversation

@laurit
Copy link
Contributor

@laurit laurit commented Nov 4, 2024

With #12444 we set up byte buddy twice. First before otel sdk is built we set up some virtual field transforms so that classes loaded during otel sdk initialization wouldn't need to use fallback map for virtual fields. Later when otel sdk is built we set up rest of the transforms. This PR removes class load listener from early byte buddy instance to ensure that class load listeners are triggered only once. Currently on wildfly where running after agent listeners is triggered by loading java.util.logging.LogManager (see https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentInstaller.java#L309) class load listener for java.util.logging.LogManager is triggered twice which causes a lot of warnings like

2024-11-03T05:27:34.9145838Z     App - STDERR: [otel.javaagent 2024-11-03 05:27:34:893 +0000] [PeriodicMetricReader-1] WARN io.opentelemetry.sdk.metrics.internal.state.AsynchronousMetricStorage - Instrument jvm.memory.used has recorded multiple values for the same attributes: {jvm.memory.pool.name="PS Survivor Space", jvm.memory.type="heap"}

@laurit laurit requested a review from a team as a code owner November 4, 2024 14:56
@trask trask added this to the v2.10.0 milestone Nov 4, 2024
@laurit laurit merged commit 2b5c4f5 into open-telemetry:main Nov 5, 2024
56 checks passed
@laurit laurit deleted the class-load-listener branch November 5, 2024 12:08
akats7 pushed a commit to akats7/opentelemetry-java-instrumentation that referenced this pull request Nov 21, 2024
akats7 pushed a commit to akats7/opentelemetry-java-instrumentation that referenced this pull request Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants